﻿using System;
using System.Collections.Generic;
using System.ComponentModel.Composition;
using System.Linq;
using System.Text;
using Caliburn.Core.InversionOfControl;
using Microsoft.Win32;

namespace MTGenome.ViewModels
{
    [Singleton(typeof(DialogViewModel)), PartCreationPolicy(CreationPolicy.Shared)]
    public sealed class DialogViewModel
    {
        private const string EXT = ".MTGen";

        private readonly OpenFileDialog _openFile = null;
        private readonly SaveFileDialog _saveFile = null;

        public DialogViewModel()
        {
            _openFile = new OpenFileDialog();
            _openFile.DefaultExt = EXT;
            _openFile.Filter = "MTGenome Files|*" + EXT;
            _openFile.Title = "Open File";
            _openFile.Multiselect = false;

            _saveFile = new SaveFileDialog();
            _saveFile.DefaultExt = EXT;
            _saveFile.Filter = "MTGenome Files|*" + EXT;
            _saveFile.Title = "Save File";
            _saveFile.OverwritePrompt = true;
        }

        public OpenFileDialog OpenFile
        {
            get { return _openFile; }
        }

        public SaveFileDialog SaveFile
        {
            get { return _saveFile; }
        }
    }
}
